<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<title>Embedded scripts</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>

<body>

<div align="center">
<table class=allEncompassingTable >
 <tr>
  <td >
<p><a href="../index.html" TARGET="_top"><img src="images/homeImg.png"></a></p>



<h1>Embedded scripts</h1>

<p>CoppeliaSim supports, next to <a href="sandboxScript.htm">the sandbox script</a> and <a href="addOns.htm">add-ons</a>, also embedded scripts: an embedded script is a script that is embedded in a <a href="scenes.htm">scene</a> (or <a href="models.htm">model</a>), i.e. a script that is part of the scene and that will be saved and loaded together with the rest of the scene (or model). There are different types of embedded scripts that are supported. Each type has specific features and application areas:</p>
<p align=center><img src="images/simulationScripts.jpg"></p>
<p class=imageLabel>[Embedded script types]</p>
<br>

<p>Two major types of embedded scripts are supported: </p>

<li><a href="simulationScripts.htm">Simulation scripts</a>: simulation scripts are scripts that are executed only during simulation, and that are used to customize a simulation or a simulation model. The main simulation loop is handled via the <a href="mainScript.htm">main script</a>, and models/robots can be controlled via <a href="childScripts.htm">child scripts</a>.</li>

<li><a href="customizationScripts.htm">Customization scripts</a>: those are scripts that can also be executed while simulation is not running, and that are used to customize a simulation scene or a specific model.</li>





<br>

<p>It is useful to remember that some script types are associated with <a href="objects.htm">scene objects</a> (attached to scene objects, i.e. <em>associated</em> scripts) such as child scripts and customization scripts. Associated scripts, which form the basis of CoppeliaSim's distributed control architecture, share the convenient property to be automatically duplicated if their associated object is duplicated.</p>

<p>Embedded scripts, and all scripts in general, are invoked via <a href="callbackFunctions.htm">callback functions</a> by CoppeliaSim, and follow a <a href="scriptExecution.htm">specific execution order</a>. They can <a href="threadedAndNonThreadedCode.htm">run threaded or non-threaded</a>.</p>

<br>
<br>
 </tr>
</table> 
</div>  
  
  
</body>

</html>
